﻿namespace Ocelot.Admin.Api.Application
{
    public interface IProjectService
    {
        #region 查询

        /// <summary>
        /// 查询项目信息
        /// </summary>
        /// <returns></returns>
        Task<List<Project>> GetProjectsAsync();

        /// <summary>
        /// 分页查询项目信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<SqlSugarPagedList<Project>> GetPageProjectAsync(PageProjectRequest request);

        /// <summary>
        /// 查询所有可用的项目Id集合
        /// </summary>
        /// <returns></returns>
        Task<List<int>> GetAllEnabledProjectIdsAsync();

        #endregion

        #region 新增

        /// <summary>
        /// 新增项目信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<string> InsertProjectAsync(InsertProjectRequest request);

        #endregion

        #region 编辑

        /// <summary>
        /// 更新项目信息
        /// </summary>
        /// <param name="request"></param>
        /// <returns></returns>
        Task<string> UpdateProjectAsync(UpdateProjectRequest request);

        /// <summary>
        /// 启用或禁用项目信息
        /// </summary>
        /// <param name="projectId">项目Id</param>
        /// <param name="enabled">是否有效</param>
        /// <returns></returns>
        Task<string> PatchProjectAsync(int projectId, bool enabled);

        #endregion

        #region 删除
        /// <summary>
        /// 删除项目信息
        /// </summary>
        /// <param name="projectId">项目Id</param>
        /// <returns></returns>
        Task<string> DeleteProjectAsync(int projectId);

        #endregion
    }
}